import { defHttp } from '@/utils/http/axios'

enum Api {
  selectDeptTreeList = '/auth/selectDeptTreeList',//获取部门树形结构列表
  selectCrmAccountPage = '/auth/selectCrmAccountPage',//CRM 网申后台账户列表
  accountStartUsingOrDelete = '/auth/accountStartUsingOrDelete',//账户列表启用/删除账户
  updateAccount = '/auth/updateAccount',//CRM 网申后台账户编辑
  selectRoleList = '/auth/selectRoleList',//CRM 获取所有角色
  refreshDingTalkUser = '/dingTalk/refreshDingTalkUser',//刷新钉钉名单
}

// 获取部门树形结构列表
export function selectDeptTreeList(data) {
  return defHttp.post({ url: Api.selectDeptTreeList, data })
}

// 账户列表启用/删除账户
export function accountStartUsingOrDelete(data) {
  return defHttp.post({ url: Api.accountStartUsingOrDelete, data })
}

// CRM 网申后台账户列表
export function selectCrmAccountPage(data) {
  return defHttp.post({ url: Api.selectCrmAccountPage, data })
}


// CRM 网申后台账户编辑
export function updateAccount(data) {
  return defHttp.post({ url: Api.updateAccount, data })
}
// 获取所有角色
export function selectRoleList(params) {
  return defHttp.get({ url: Api.selectRoleList, params })
}
// 刷新钉钉名单
export function refreshDingTalkUser(data) {
  return defHttp.post({ url: Api.refreshDingTalkUser, data })
}